/*
 * @Date: 2024-11-22 17:27:41
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2024-11-25 09:50:04
 * @Description: 
 */
import { defineComponent, h, watch } from "vue";
import "element-plus/es/components/select/style/css";
import { ElSelect, ElOption } from "element-plus";

export default defineComponent({
  emits: ["update:modelValue"],
  setup(_, { emit, attrs }) {
    function handleUpdate(e = null) {
      emit("update:modelValue", e);
    }
    return () => {
      const props = {
        ...attrs,
        key: String(attrs.multiple),
        "onUpdate:modelValue": handleUpdate,
      }
      return h(ElSelect, props, {
        default: () => [
          props.options?.map((option) => {
            return h(ElOption, { label: option.label, value: option.value })
          })
        ]
      })
    }
  }
})
